/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zcc
* @date 2021-07-03
**/
@Entity
@Data
@Table(name="fz_allsize")
public class FzAllSize implements Serializable {

    @Id
    @Column(name = "as_id")
    @ApiModelProperty(value = "样品id")
    private String asId;

    @Column(name = "file_name",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "文件名称")
    private String fileName;

    @Column(name = "date_time",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "日期")
    private String dateTime;

    @Column(name = "customer")
    @ApiModelProperty(value = "客户")
    private String customer;

    @Column(name = "types",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "类别")
    private String types;

    @Column(name = "feilin",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "菲林")
    private String feilin;

    @Column(name = "model",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "模具")
    private String model;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "needle_num",nullable = false)
    @NotNull
    @ApiModelProperty(value = "针数")
    private Integer needleNum;

    @Column(name = "sample_rows",nullable = false)
    @NotNull
    @ApiModelProperty(value = "行数")
    private Integer sampleRows;

    @Column(name = "single_chip_time",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "单片时间")
    private String singleChipTime;

    @Column(name = "weight",nullable = false)
    @NotNull
    @ApiModelProperty(value = "单片重量")
    private Integer weight;

    @Column(name = "scald_temp",nullable = false)
    @NotNull
    @ApiModelProperty(value = "烫机温度")
    private Integer scaldTemp;

    @Column(name = "scald_speed",nullable = false)
    @NotNull
    @ApiModelProperty(value = "烫机速度")
    private Integer scaldSpeed;

    @Column(name = "scald_pre",nullable = false)
    @NotNull
    @ApiModelProperty(value = "烫机压力")
    private Integer scaldPre;

    @Column(name = "allsize_technology_id")
    @ApiModelProperty(value = "样品工艺")
    private String allsizeTechnologyId;

    public void copy(FzAllSize source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public void copyTo(FzOrders source){
        BeanUtil.copyProperties(this, source, CopyOptions.create().setIgnoreNullValue(true));
    }
}
